import 'package:flutter_app_study/bean/hot_entity.dart';

hotEntityFromJson(HotEntity data, Map<String, dynamic> json) {
	if (json['data'] != null) {
		data.data = new List<HotData>();
		(json['data'] as List).forEach((v) {
			data.data.add(new HotData().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> hotEntityToJson(HotEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	if (entity.data != null) {
		data['data'] =  entity.data.map((v) => v.toJson()).toList();
	}
	return data;
}

hotDataFromJson(HotData data, Map<String, dynamic> json) {
	if (json['picUrl'] != null) {
		data.picUrl = json['picUrl']?.toString();
	}
	if (json['title'] != null) {
		data.title = json['title']?.toString();
	}
	return data;
}

Map<String, dynamic> hotDataToJson(HotData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['picUrl'] = entity.picUrl;
	data['title'] = entity.title;
	return data;
}